package com.liuguang.gateway.controller;

import com.liuguang.api.search.SearchService;
import com.liuguang.common.pojo.CommonResult;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: SearchController
 * @Description：
 * @Author: wanghr
 * Date: 3:23 PM 2020/10/20
 * Version: 1.0
 */
@RestController
@RequestMapping("/search")
public class SearchController {
//    @DubboReference(timeout = 40000)
    private SearchService searchService;

    /**
     * 本该在项目启动的时候就进行 Es 的仓库初始化，但现在写成接口模式
     */
    @RequestMapping("/initRepository")
    public CommonResult initRepository() {
        return searchService.initRepository();
    }
}
